/*
*   Grupo 2:		Ana Elisa Siena			7126563
*                       Larissa Zimmermann		7126879
* 
*   Jogo em Java - AngryBirds
*   SCC - 604 - Programação Orientada a Objetos
*   Prof. Fernando V. Paulovich
*   Engenharia de Computação 010 - USP - São Carlos
*   Segundo Semestre de 2011 
*	
*/


package angrybirds.main;

import angrybirds.menus.MenuInicial;
import angrybirds.menus.MenuFases;
import angrybirds.fases.Fase1;
import angrybirds.fases.Fase2;
import angrybirds.fases.Fase3;
import angrybirds.fases.Fase4;
import angrybirds.fases.Fase5;
import angrybirds.fases.Ganhou;
import angrybirds.fases.Perdeu;
import java.awt.Dimension;
import java.awt.Toolkit;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

/*******************************************************************************
*	Nome da classe:     Angrybirds
*	O que faz:          Inicializa todo o jogo          		
*******************************************************************************/

public class Angrybirds extends StateBasedGame{

    public static final int MAINMENUSTATE = 0;//estado inicial
    public static final int CHOOSEGAMEPLAYSTATE = 2;//estado de jogo
    public static final int GAMEPLAYSTATE = 3;
    public static final int FASE1 = 4;
    public static final int FASE2 = 5;
    public static final int FASE3 = 6;
    public static final int FASE4 = 7;
    public static final int FASE5 = 8;
    public static final int PERDEU = 9;
    public static final int GANHOU = 10;
    
    private static final Dimension D = Toolkit.getDefaultToolkit().getScreenSize();
    
    public static final float width = (float)D.width;
    public static final float height = (float)D.height;
    

    public Angrybirds() throws SlickException {
        super("Angry Birds");

        this.addState(new MenuInicial(MAINMENUSTATE));
        this.addState(new MenuFases(CHOOSEGAMEPLAYSTATE));
        this.addState(new Fase1(FASE1));
        this.addState(new Fase2(FASE2));
        this.addState(new Fase3(FASE3));
        this.addState(new Fase4(FASE4));
        this.addState(new Fase5(FASE5));
        this.addState(new Perdeu(PERDEU));
        this.addState(new Ganhou(GANHOU));
        this.enterState(MAINMENUSTATE);
    }

    @Override
    public void initStatesList(GameContainer gameContainer) throws SlickException {
        this.getState(MAINMENUSTATE).init(gameContainer, this);
        this.getState(CHOOSEGAMEPLAYSTATE).init(gameContainer, this);
        this.getState(FASE1).init(gameContainer, this);
        this.getState(FASE2).init(gameContainer, this);
        this.getState(FASE3).init(gameContainer, this);
        this.getState(FASE4).init(gameContainer, this);
        this.getState(FASE5).init(gameContainer, this);
        this.getState(PERDEU).init(gameContainer, this);
        this.getState(GANHOU).init(gameContainer, this);
        this.getState(PERDEU).init(gameContainer, this);
        this.getState(GANHOU).init(gameContainer, this);
    }

    public static void main(String[] args) throws SlickException {

        AppGameContainer app = new AppGameContainer(new Angrybirds());

        app.setDisplayMode(800, 600, false);//"False" para o fullscreen.
       
        app.start();
    }

}

